﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.DAL;

public partial class ZKDepthDetials : System.Web.UI.Page
{
    private string strZKID, strBBID, strBPID, strGPID, strYPID, strXGID,strPMID;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["zkid"] != null || Request["bbid"] != null || Request["bpid"] != null || Request["gpid"] != null || Request["ypid"] != null || Request["xgid"] != null || Request["pmid"] != null)
        {
            strZKID = Request["zkid"];
            strBBID = Request["bbid"];
            strBPID = Request["bpid"];
            strGPID = Request["gpid"];
            strYPID = Request["ypid"];
            strXGID = Request["xgid"];
            strPMID = Request["pmid"];
            if (strZKID != null)
            {
                ///////////////////////////////////////////////////////////////////钻孔信息
                YXInfo yxdeepobj = new YXInfo();
                this.ZKGridView.DataSource = yxdeepobj.GetInfoByID(Convert.ToInt32(strZKID));
                this.ZKGridView.DataBind();
                ZKDIV.Attributes.Add("style", "display:block");
            }
            if (strBBID != null)
            {
                ///////////////////////////////////////////////////////////////////标本信息
                BBInfo bbdeepobj = new BBInfo();
                this.BBGridView.DataSource = bbdeepobj.SelectByBBID(strBBID);
                this.BBGridView.DataBind();
                BBDIV.Attributes.Add("style", "display:block");
            }
            if (strBPID != null)
            {

                ///////////////////////////////////////////////////////////////////薄片信息
                BPInfo bpdeepobj = new BPInfo();
                this.BPGridView.DataSource = bpdeepobj.SelectByBPID(Convert.ToInt32(strBPID));
                this.BPGridView.DataBind();
                BPDIV.Attributes.Add("style", "display:block");
            }
            if (strGPID != null)
            {
                ///////////////////////////////////////////////////////////////////光片信息
                GPInfo gpdeepobj = new GPInfo();
                this.GPGridView.DataSource = gpdeepobj.SelectByGPID(Convert.ToInt32(strGPID));
                this.GPGridView.DataBind();

                GPDIV.Attributes.Add("style", "display:block");
            }
            if (strYPID != null)
            {

                ///////////////////////////////////////////////////////////////////样品信息
                YPInfo ypdeepobj = new YPInfo();
                this.YPGridView.DataSource = ypdeepobj.SelectByYPID(strYPID);
                this.YPGridView.DataBind();

                YPDIV.Attributes.Add("style", "display:block");
            }
            if (strXGID != null)
            {
                //strXGID.Trim().Replace(" ", "") 
                ///////////////////////////////////////////////////////////////////相关资料
                XGInfo xgdeepobj = new XGInfo();
                this.XGGridView.DataSource = xgdeepobj.SelectByXGID(strXGID);
                this.XGGridView.DataBind();

                XGDIV.Attributes.Add("style", "display:block");
            }
            if (strPMID != null)
            {
                //strXGID.Trim().Replace(" ", "") 
                ///////////////////////////////////////////////////////////////////相关资料
                PMInfo pmdeepobj = new PMInfo();
                this.PMGridView.DataSource = pmdeepobj.SelectInfoByID(Convert.ToInt32(strPMID));
                this.PMGridView.DataBind();

                PMDIV.Attributes.Add("style", "display:block");
            }
        }
        else
        {
            Response.Write("<script lanuage=javascript>alert('没有对应的信息');location='javascript:history.go(-1)'</script> ");
        }
        //bind();
    }
    //protected void bind()
    //{

    //protected void ZKGridView_RowDataBound(object sender, GridViewRowEventArgs e)
    //{
    //    if (e.Row.RowType == DataControlRowType.DataRow)
    //    {
    //        string JS = "ZKImgInfo.aspx?zkid=" + e.Row.Cells[1].Text.ToString();
    //        //string deepth = e.Row.Cells[2].Text.ToString();
    //        e.Row.Cells[3].Text = "<a href=\"javascript:\" onclick=\"javascript:window.open('" + JS + "','添加','top=50,left=150,toolbar=no, menubar=no,scrollbars=yes, resizable=no, location=no, status=no, width=1100,height=730');addBuyAccount.focus(0); \">查看</a>";
            
    //    }
    //}

        
       
     
      
      
}
